package dataAcsessObject;

/**
 *
 * @author Juan Sebastian Hernández Serrato
 */
public class JPADAOFactory extends AbstractDAOFactory{

    private static JPADAOFactory instance = null;
    
    private JPADAOFactory(){}
    
    public static JPADAOFactory getInstance(){
        if (instance == null) {
            instance = new JPADAOFactory();
        }
        return instance;
    }
    
    private CategoryDAO categoryDAO;
    private CourseDAO courseDAO;
    private NodeDAO nodeDAO;
    private ProfessorDAO professorDAO;
    private RoleDAO roleDAO;
    private UniversityDAO universityDAO;
    private UserDAO userDAO;
    
    @Override
    public CategoryDAO getCategoryDAO() {
        if (categoryDAO == null) {
            categoryDAO = new CategoryDAO();
        }
        return categoryDAO;
    }

    @Override
    public CourseDAO getCourseDAO() {
        if (courseDAO == null) {
           courseDAO = new CourseDAO(); 
        }
        return courseDAO;
    }

    @Override
    public NodeDAO getNodeDAO() {
        if (nodeDAO == null) {
            nodeDAO = new NodeDAO();
        }
        return nodeDAO;
    }

    @Override
    public ProfessorDAO getProfessorDAO() {
        if (professorDAO == null) {
            professorDAO = new ProfessorDAO();
        }
        return professorDAO;
    }

    @Override
    public RoleDAO getRoleDAO() {
        if (roleDAO == null) {
            roleDAO = new RoleDAO();
        }
        return roleDAO;
    }

    @Override
    public UniversityDAO getUniversityDAO() {
        if (universityDAO == null) {
            universityDAO = new UniversityDAO();
        }
        return universityDAO;
    }

    @Override
    public UserDAO getUserDAO() {
        if(userDAO == null){
           userDAO = new UserDAO();
        }
        return userDAO;
    }
    
    
}
